package com.test.burnincash.view_burnin.view_inflater_burnin;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.test.burnincash.R;
import com.test.burnincash.util_burnin.StringUtil_burnin;

public class BankAccountViewInflater_burnin {

    private final TextView bankNameTv;
    private final TextView bankAccountTv;
    private final ImageView checkIv;
    private final View clickView;

    public BankAccountViewInflater_burnin(View view, int index){
        bankNameTv = view.findViewById(R.id.item_bank_account_niri_tv_bank_name);
        bankAccountTv = view.findViewById(R.id.item_bank_account_niri_tv_bank_account);
        checkIv = view.findViewById(R.id.item_bank_account_niri_iv_check);
        clickView = view.findViewById(R.id.item_bank_account_niri_view_click);
    }

    public void setCheck(boolean check){
        checkIv.setBackgroundResource(check ? R.drawable.icon_item_check_true:R.drawable.icon_item_check_false);
    }

    public void setBankName(String bankName){
        bankNameTv.setText(StringUtil_burnin.getSafeString(bankName));
    }

    public void setBankAccount(String bankAccount){
        bankAccountTv.setText(StringUtil_burnin.getSafeString(bankAccount));
    }

    public void setOnClickListener(View.OnClickListener onClickListener){
        clickView.setOnClickListener(onClickListener);
    }

}
